//
//  TMController.h
//  Textmaster
//
//  Created by Anshu Chimala on 1/1/10.
//  Copyright 2010 MediaLocal LLC. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <BWToolkitFramework/BWToolkitFramework.h>
#import "TMMacro.h"
#import "TMWindow.h"

@interface TMController : NSObject <TMMacroDelegate> {
	NSTableView *_tableView;
	NSTextField *_titleText, *_authorText;
	NSTextView *_descriptionText, *_beforeText, *_afterText;
	NSSearchField *_searchText;
	IBOutlet NSPanel *_progressScreen, *_aboutScreen, *_catalogScreen, *_welcomeScreen;
	IBOutlet TMFadePanel *_preferencesScreen;
	IBOutlet NSProgressIndicator *_progressWheel;
	IBOutlet NSTextField *_progressLabel;
	
	NSMutableArray *_macros, *_filteredMacros;
	BOOL _showActivityIndicator;
	BOOL _userCanEditSampleText;
	BOOL _shouldPasteAfterwards;
}

@property (nonatomic, assign) IBOutlet NSTableView *tableView;
@property (nonatomic, assign) IBOutlet NSTextField *titleText, *authorText;
@property (nonatomic, assign) IBOutlet NSTextView *descriptionText, *beforeText, *afterText;
@property (nonatomic, assign) IBOutlet NSSearchField *searchText;

@property (nonatomic, retain) NSMutableArray *macros;

- (IBAction)doSearch:(id)sender;
- (IBAction)showAboutPanel:(id)sender;
- (IBAction)dismissAboutPanel:(id)sender;
- (IBAction)showPreferences:(id)sender;
- (IBAction)dismissPreferences:(id)sender;
- (IBAction)showCatalog:(id)sender;
- (IBAction)dismissCatalog:(id)sender;
- (IBAction)addMacroFromFile:(id)sender;
- (IBAction)deleteMacro:(id)sender;
- (IBAction)executeMacro:(id)sender; // Tied to a hidden NSButton. This is bad. UPDATE: Fixed it, lol :)
- (IBAction)dismissWelcomePanel:(id)sender;
- (IBAction)dismissWelcomePanelAndShowCatalog:(id)sender;

@end
